#pragma once
#include <iostream>

    class Task
    {
    public:
        Task(const int& x = 1, const int& y = 1, const char op = '+')
            : a(x), b(y), _op(op)
        {

        }
        ~Task()
        {
        }

        void Run()
        {
            int ret = 0;
            switch (_op)
            {
            case ('+'):
                ret = a+b;
                break;
            case ('-'):
                ret = a-b;
                break;
            case ('*'):
                ret = a*b; 
                break;
            case ('/'):
                ret = a/b;//暂不考虑b为0；
                break;
            case ('%'):
                ret = a%b;//暂不考虑b为0
                break;
            default:
                std::cout << "未知操作符" << std::endl;
                break;
            }

            std::cout<< a << _op << b << '=' << ret << std::endl;
        }

        void operator()()   
        {
            Run();
        }

    private:
        int a;
        int b;
        char _op;
    };

